package callable;

import java.util.TreeMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class CallableTest {
    public static void main(String[] args) {
        FutureTask ft = new FutureTask(new MyCallableThread());
        Thread t1 = new Thread(ft);
        t1.start();
        try {
            Object o = ft.get();
            System.out.println("返回结果：" + o);
        } catch (InterruptedException e) {
            e.printStackTrace();
        } catch (ExecutionException e) {
            e.printStackTrace();
        }

    }
}
